package com.xxgc.demo.job;
/*
 *
 *   @Author:Sjy
 *   @Date: 2023/9/27-09-27-11:06
 *
 */

import com.xxgc.demo.utils.SpeechSynthesisUtil;
import lombok.extern.slf4j.Slf4j;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import java.text.SimpleDateFormat;
import java.util.Date;

@Slf4j
public class ToControllerJob implements Job {
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        log.info("我定时任务已经执行");
        SpeechSynthesisUtil ttsTool = new SpeechSynthesisUtil("0adfa098");

        SimpleDateFormat formatter = new SimpleDateFormat("yyyy年MM月dd日HH时mm分ss秒");
        Date currentTime = new Date();// 得到当前系统时间
        String str_date = formatter.format(currentTime); // 将日期时间格式化

        ttsTool.textToVoice("现在是北京时间："+str_date);
    }
}
